//
//  MassPersonController.m
//  毕业设计
//
//  Created by 龙波 on 2017/9/19.
//  Copyright © 2017年 ----龙波. All rights reserved.
//

#import "MassPersonController.h"
#import "MassTextController.h"

@interface MassPersonController ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation MassPersonController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self setupNav];
    [self setuptableview];
}

- (void)setupNav
{
    self.navigationItem.title = @"我的社团";
}

- (void)setuptableview
{
    UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTH, SCREENHEIGHT)];
    tableView.delegate = self;
    tableView.dataSource = self;
    
    [self.view addSubview:tableView];
    
    
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 100;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static  NSString *MassPersonID = @"MassPersonCellID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MassPersonID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:MassPersonID];
        cell.selectionStyle = UITableViewStylePlain;

        
    }
    UIImageView *image=[[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 100, 80)];
    image.contentMode=UIViewContentModeScaleAspectFill;
    image.clipsToBounds=YES;
    [cell.contentView addSubview:image];
 
    UILabel *titlelabel=[[UILabel alloc]initWithFrame:CGRectMake(110, 5, 150, 30)];
    titlelabel.font=[UIFont boldSystemFontOfSize:21];
    titlelabel.textColor=[UIColor blueColor];
    [cell.contentView addSubview:titlelabel];
    
    image.image = [UIImage imageNamed:@"160652984b07055d8_m"];
    titlelabel.text = @"社团名字测试";
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    MassTextController *textmc = [[MassTextController alloc]initWithFrame:self.view.frame WithArray:nil];
    
    [self.navigationController pushViewController:textmc animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
